<?php
// +----------------------------------------------------------------------
// | Author: Sam
// +----------------------------------------------------------------------
namespace plugins\article_keywords\controller;
use cmf\controller\PluginRestBaseController;

use think\Db;

class ApiIndexController extends PluginRestBaseController

{
    public function getKeywords()
    {	
        $adminId = cmf_get_current_admin_id();
        if (empty($adminId)) {
            die();
        }
		
		// 获取当前标签模块ID
		$tagmoduleid = $this->request->param("tagmoduleid");
		
		// 新增自定义模块独立表配置 DATE:2020-3-27 START
		$moduletagtable = getmoduletagtable($tagmoduleid);
		$moduletagtable = delthstr($moduletagtable,"fastxcms_","");
		// 新增自定义模块独立表配置 DATE:2020-3-27 END
		
        $datalist = Db::name($moduletagtable)->where(["status" => 1,"moduleid"=>$tagmoduleid])->order("id DESC")->paginate(20);
        $this->success($datalist);
    }

}